<!DOCTYPE html>
<!--[if IE 8]> <html lang="zh-CN" class="ie8"> <![endif]-->
<html lang="zh-CN">

	<head>
		<meta charset="utf-8" />
		<title>礼品领取</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta content="telephone=no,email=no,address=no" name="format-detection" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta name="msapplication-tap-highlight" content="no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="wap-font-scale" content="no">
		<meta name="Keywords" content="" />
		<meta name="Description" content="" />

		<link rel="stylesheet" href="__TMPL__Public/css/common.css" />
		<link rel="stylesheet" href="__TMPL__Public/css/public.css" />
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Pay/Css/flow.css" />
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Pay/Css/honeyswitch.css" />
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/User/js/area/jquery.min.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/common.js"></script>
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/Pay/js/honeyswitch.js"></script>

	</head>

	<body>
		<div class="content-main">
			<div class="content-info">
				<!-- 引入头部文件 -->
				<header>
					<div class="header" style="background: #f8f8f8;">
						<div class="header-left">
							<a class="sb-back" href="javascript:history.back(-1)" title="返回"></a>
						</div>
						<div class="header-middle">礼品领取</div>
						<div class="header-right">
							<aside class="show-menu-btn">
								<div class="show-menu" id="show_more">
									<a href="javascript:void(0);"></a>
								</div>
							</aside>
						</div>
					</div>
				</header>
				<mtc_include file="Public:right_nav" />
				<!-- 收货地址 -->
				<php>
					$data_info=I('get.');
					$data_info['type']=2;
					$url=U("user/address",$data_info);
				</php>
				<div class="address-container border-line" id="addressinfo">
					<div id="user_address_list">
						<div class="main-content">
							<!--收货地址-->
							<notempty name="useraddress">
							<div class="address-info" onclick="window.location.href='{$url}'">
								<foreach name="useraddress" item="v">
									<php>$fapiao_hader=$v['consigner']</php>
									<dl>
										<dt>
										<p class="name-phone">
											<span class="name">收货人：{$v.consigner}</span>
											<span class="phone">{$v.mobile}</span>
										</p>
										<p class="address-address-detail">
											<span>收货地址：{$v.province}&nbsp;{$v.city}&nbsp;{$v.district} {$v.address}</span>
										</p>
										<i class="iconfont">&#xe607;</i>
									</dt>
									</dl>
								</foreach>
							</div>
							</notempty>
							<empty name="useraddress">
							<php>
								$data_info['noaddess']=1;
								$url=U("user/address",$data_info);
							</php>
							<div class="address-none" onclick="window.location.href='{$url}'">
								<a href="javascript:void(0)" class="new-addr-add">
									<i class="iconfont"></i>
									新建收货地址
									<span class="right-arrow-flow ">
										<i class="iconfont"></i>
									</span>
								</a>
							</div>
							</empty>

						</div>

					</div>

				</div>
				<!-- 所有店铺商品清单 -->

				<div class="order-goods-box">
					

						<!-- 商品清单 -->
						<div class="order-list">

							
								<a href="{:U('shop/index',array('id'=>$shop_info['id']))}">
									<div class="order-list-goods">
										<dl>
											<dt><img src="{$shop_info.image}"></dt>
											<dd class="name"><strong>{$shop_info.title}</strong>
												<span>
													
													<em class="goods-num">x{$info.recommend_shop_num}</em>
              									</span>
											</dd>

										</dl>
									</div>
								</a>
						</div>
					<div class="goods-annex">
						<div class="goods-message">
							<span class="msg-title">用户留言：</span>
							<div class="buyer-msg"><textarea class="text postscript" placeholder="选填，可填写您与卖家达成一致的要求"></textarea></div>
						</div>
					</div>
					
					
				</div>
			
				<!-- 提交订单 -->
				<div style="text-align: center;margin-top: 8px;">
					<a href="javascript:void(0)" class="gopay" style="background: #e00;padding: 5px 7px;color: #fff;border-radius: 4px;">立即领取</a>
				</div>

			</div>
		</div>
		<script src="/themes/wnsc_moblie/newMobile/Shop/js/mobile/layer.js"></script>
		<script type="text/javascript">
			$(function(){
				$('.gopay').click(function(){
					var rec_id={$_GET['rec_id']};
					var recommend_shop_id={$_GET['recommend_shop_id']};
					var recommend_shop_num={$_GET['recommend_shop_num']};
					var leavemessage=$('.postscript').val();
					$.ajax({
						url : "/pay/generate_order2",
						type : "post",
						data : { 
							"leavemessage" : leavemessage,
							"rec_id" : rec_id,
							"recommend_shop_id" : recommend_shop_id,
							"recommend_shop_num" : recommend_shop_num
						},
						success : function(res){
							if(res.code==1){
								layer.open({
								    content: res.message
								    ,skin: 'msg'
								    ,time: 2 //2秒后自动关闭
								});
								setTimeout("window.location.href='/user/order_info/order/"+res.data+"';",2000);
							}else{
								layer.open({
								    content: res.message
								    ,skin: 'msg'
								    ,time: 2 //2秒后自动关闭
								});
								
							}
						}
					});
					
				})
			})
		</script>
	</body>

</html>